﻿using System.Xml.Serialization;

namespace WebGodService
{
  public class SearchRequest
  {
    public enum Sexes { Female, Male, All };

    [XmlElement(IsNullable = true)]
    public string Name { get; set; }

    [XmlElement(IsNullable = false)]
    public Sexes Sex { get; set; }

    [XmlElement(IsNullable = true)]
    public string ParentName { get; set; }

    [XmlElement(IsNullable = true)]
    public Interval<int> ChildAge { get; set; }

    [XmlElement(IsNullable = true)]
    public Interval<int> ParentAge { get; set; }

    [XmlElement(IsNullable = true)]
    public Interval<double> AvgMark { get; set; }

    [XmlElement(IsNullable = true)]
    public Interval<int> ChildCount { get; set; }


    public class Interval<T>
    {

      [XmlElement(IsNullable = false)]
      public T From { get; set; }

      [XmlElement(IsNullable = false)]
      public T To { get; set; }
    }

  }
}
